﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Program05._1
{
    //成绩管理类
    public class GradeManage
    {
        public Student Stu { get; }
        public Course1 C1 { get; }
        public Course2 C2 { get; }
        //总分
        public int Sum { get; }
        public GradeManage()
        {

        }
        //只初始化学生的构造方法
        public GradeManage(string stuNo ,string stuNmae,int age)
        {
            Stu = new Student
            {
                NO = stuNo,
                Name = stuNmae,
                Age = age
            };
        }
        //带课程的构造方法
        public GradeManage(string stuNo, string stuNmae, int age, 
            string cName1,int cPeriod1,int cCredit1,int cScore1,
            string cName2, int cPeriod2, int cCredit2, int cScore2)
        {
            Stu = new Student
            {
                NO = stuNo,
                Name = stuNmae,
                Age = age
            };
            C1 = new Course1
            {
                Name = cName1,
                Period = cPeriod1,
                Creidt = cCredit1,
                Score = cScore1
            };
            C2 = new Course2
            {
                Name = cName2,
                Period = cPeriod2,
                Creidt = cCredit2,
                Score = cScore2
            };
            //打印方法
            Sum = C1.Score + C2.Score;
        }
        public void Print() => Console.WriteLine($"{Stu}{C1}{C2}总分{Sum}");
    }
}
